package com.kclm.xsap.entity;

import com.baomidou.mybatisplus.annotation.*;

import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.*;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotNull;


@Data
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper=false)
@TableName("t_schedule_record")
@Accessors(chain = true)
public class ScheduleRecordEntity implements Serializable {
	private static final long serialVersionUID = 1L;

	
	@TableId
	private Long id;
	
	@NotNull(message = "请选择课程")
	private Long courseId;
	
	@TableField(exist = false)
	private Long courseDuration;
	
	@NotNull(message = "请选择上课老师")
	private Long teacherId;
	
	private Integer orderNums;
	
	@NotNull(message = "请确定上课日期")
	@DateTimeFormat(pattern = "yyyy-MM-dd")
	private LocalDate startDate;
	
	@DateTimeFormat(pattern = "HH:mm")
	private LocalTime classTime;
	
	private String limitSex;
	
	private Integer limitAge;
	
	@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
	@TableField(fill = FieldFill.INSERT)
	private LocalDateTime createTime;
	
	@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
	@TableField(fill = FieldFill.INSERT_UPDATE)
	private LocalDateTime lastModifyTime;
	
	@Version
	private Integer version=1;

	
	@TableField(exist = false)
	@ToString.Exclude
	private CourseEntity courseEntity;


	
	@TableField(exist = false)
	@ToString.Exclude
	private EmployeeEntity employeeEntity;

}
